package cn.melonlib.cores.identification.comp.messenger;

import cn.melonlib.cores.identification.model.entity.Identification;
import cn.melonlib.cores.identification.model.entity.Organization;
import com.ctc.wstx.util.StringUtil;
import org.apache.commons.lang3.StringUtils;

/**
 * 认证容器
 */
public interface IdentificationMessenger<I extends Identification,O extends Organization> {

    /**
     * 获取认证容器
     * @return
     */
    I getIdentification();

    /**
     * 获取当前组织机构(租户信息)
     * @return
     */
    O getOrganization();

    /**
     * 获取认证token
     * @return
     */
    String getToken();

    default boolean checkAuth(){
        return StringUtils.isNotBlank(getToken());
    }

}
